#pragma once

#include "ConsiderIgnoreFragment.h"

#include "NamedElement.h"

namespace uml {

ConsiderIgnoreFragment::ConsiderIgnoreFragment(const QString& umlType)
    : CombinedFragment(umlType) {}

void ConsiderIgnoreFragment::fromJson(const QJsonObject& json, QStringList& errorList) {
    if (json.isEmpty()) {
        return;
    }

    CombinedFragment::fromJson(json, errorList);
    JsonSerializable::fromJsonArray(messages_, "messages", json, errorList);
}

void ConsiderIgnoreFragment::toJson(QJsonObject& json) {
    CombinedFragment::toJson(json);
    JsonSerializable::toJsonArray(messages_, "messages", json);
}

/// <summary>
/// messages getter
/// The set of messages that apply to this fragment.
/// </summary>
vector<shared_ptr<NamedElement>>& ConsiderIgnoreFragment::messages() {
    return messages_;
}

} // namespace uml
